<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Thêm nhóm quyền</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/user.css">
    <link href="css/admin.css" rel="stylesheet">
    <!-- Optional theme -->
    <link rel="stylesheet" href="css/bootstrap-theme.min.css">
    <script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
    <!-- Latest compiled and minified JavaScript -->
    <script src="js/bootstrap.min.js"></script>
    <!-- Latest compiled and minified CSS -->  
</head>
<body>
<!--header-->
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">TRANG QUẢN TRỊ VEMIENTRUNG.COM</a>
            </div>

            <div class="navbar-collapse collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Chào bạn, admin <span class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li><div class="account"><img src="http://www.marrybaby.vn/wp-content/uploads/users/8/2013/12/10/1386669652e48_avartar.jpg_400.jpg" width="100" height="100"/>
                                <p class="a"><a href="#">Admin</a></p>
                                <p><a href="#">Thay đổi hồ sơ cá nhân</a></p>
                                <p><a href="#">Đăng xuất</a></p>
                            </div>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
        </div>
    </nav>
<!--end header-->   
<!--content-->
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar list">
                <li class="active"><a href="#"><span class="glyphicon glyphicon-home"></span> Trang chủ</a></li>
                <li><a href="#"><span class="glyphicon glyphicon-file"></span> Bài viết</a></li>
                <li><a href="#"><span class="glyphicon glyphicon-map-marker"></span> Địa điểm du lịch</a></li>
                <li><a href="#"><span class="glyphicon glyphicon-flag"></span> Tour du lịch</a></li>          
                <li><a><span class="glyphicon glyphicon-user"></span> Thành viên</a>
                    <ul>
                        <li data-target="#test"><a href="" title="">Tất cả người dùng</a></li>
                        <li data-target="#test"><a href="" title="">Thêm mới</a></li>
                        <li data-target="#test"><a href="" title="">Hồ sơ cá nhân</a></li>
                        <li data-target="#test"><a href="" title="">Quản lý nhóm</a></li>
                        <li data-target="#test"><a href="" title="">Quản lý chức năng</a></li>
                    </ul>
                </li>
                <li><a href=""><span class="glyphicon glyphicon-stats"></span> Thống kê</a></li>            
                <li><a href=""><span class="glyphicon glyphicon-cog"></span> Cài đặt</a></li>
            </ul>
            <img src="images/logo.jpg" height="80" width="80%" alt="logo">
            <hr>
            <embed type="application/x-shockwave-flash" allowscriptaccess="never" style="width:150px;height:150px;" src="http://nghethuatit.com/webFlash/FlashClock1.swf" wmode="transparent" height="200" width="200">
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h2>Thêm nhóm quyền</h2>
            <hr>
            <form enctype="multipart/form-data" action="" method="post">
            <div class="col-md-6">
                <div class="panel panel-default">
                  <div class="panel-heading">Thông tin nhóm</div>
                    <div class="panel-body">
                    <div class="form-group">
                    <label class="label-control" for="tennhom">Tên nhóm</label>
                    <input type="text" class="form-control" name="" id="tennhom"  placeholder="Nhập tên nhóm">
                    </div>
                     <div class="form-group">
                    <label class="label-control" for="mota">Mô tả</label>
                    <input type="text" class="form-control" name="" id="mota" placeholder="Nhập mô tả nhóm">
                    </div>
                  </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="panel panel-default">
                    <div class="panel-heading">Chọn chức năng cho nhóm</div>
                    <div class="panel-body" style="overflow-y: auto; height:350px;">
                        <div class="checkbox">
                            <div>
                                <label>
                                    <input type="checkbox" onClick="toggle(this)" name="select-all" id="select-all" value="">
                                    Tất cả
                                </label>
                            </div>
                            <div class="child">
                            <div>                           
                                <label>
                                    <input type="checkbox" name="check_list[]" value="11">
                                    Chức năng 1 
                                </label>
                            </div>
                            <div>
                                <label>
                                    <input type="checkbox" name="check_list[]" value="21">
                                    Chức năng 1 
                                </label>
                            </div>
                            <div>
                                <label>
                                    <input type="checkbox" name="check_list[]" value="13">
                                    Chức năng 1 
                                </label>
                            </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div> 
            <div class="form-group form-inline clear text-center">
                <button name="save" type="submit" class="btn btn-success form-control">Lưu</button>
                <button class="btn btn-warning form-control">Hủy</button>
               <!--  <?php
               /* if(isset($_POST['save'])){
                    $ids = array();
                    if(!isset($_POST['check_list']))
                        return;
                    foreach($_POST['check_list'] as $val){
                        $ids[] = (int) $val;
                    }
                    //$ids = implode(',', $ids);
                    echo "<pre>";
                    print_r($ids)
                    echo "</pre>";
                }*/
                ?> -->
            </div>
            </form>
    </div>
    </div>
    <script type="text/javascript">$('.list > li a').click(function() {
    $(this).parent().find('ul').toggle();
    });</script> 

    // <script type="text/javascript">
    // $('#select-all').click(function(event) {   
    //     if(this.checked) {
    //         // Iterate each checkbox
    //         $(':checkbox').each(function() {
    //             this.checked = true;                        
    //         });
    //     }
    // });
   function toggle(source) {
  checkboxes = document.getElementsByName('check_list[]');
  for(var i=0, n=checkboxes.length;i<n;i++) {
    checkboxes[i].checked = source.checked;
  }
}
    // </script>
</body>
</html>